C23456789012345678901234567890123456789012345678901234567890123456789012
      INTEGER*4 SYS$ASSIGN
      INTEGER*4 SYS$QIOW
      CHARACTER*4 TERM
      BYTE OUTMES
C
      INCLUDE '($IODEF)'
C
      READ (1,5) TERM
5       FORMAT (A4)
C
      KERRFLAG=SYS$ASSIGN(%DESCR(TERM),JOHN,,)
      IF(.NOT.KERRFLAG) WRITE (6,*) 'ASSIGN FAILURE'
C
      IFUNCT=IO$_READVBLK
10    WRITE (6,*) 'WAITING'
      LERRFLAG=SYS$QIOW(,%VAL(JOHN),%VAL(IFUNCT),,,,%REF(OUTMES),%VAL(1)
     $,,,,)
      IF(.NOT.LERRFLAG) WRITE (6,*) 'READ FAILURE'
C
      WRITE (6,*) OUTMES
      IF (OUTMES.NE.16) GO TO 10
C
      STOP
      END
